package net.pinnoocle.playweb.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.pinnoocle.playcommon.aop.PassToken;
import net.pinnoocle.playcommon.response.BaseResult;
import net.pinnoocle.playdao.entity.SimpleUserInfoVo;
import net.pinnoocle.playdao.entity.page.PageModel;
import net.pinnoocle.playdao.entity.web.QrCodeVo;
import net.pinnoocle.playdao.entity.web.group.GroupDetailVo;
import net.pinnoocle.playdao.entity.web.group.GroupListPageVo;
import net.pinnoocle.playdao.entity.web.group.GroupListSearchParams;
import net.pinnoocle.playservice.service.impl.GroupServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ye
 * @Description
 * @create 2021-10-27 9:25
 */
@RestController
@RequestMapping("/group")
@Api(tags = "组局相关")
public class GroupController {

    @Autowired
    GroupServiceImpl groupService;

    @GetMapping("groupDetail")
    @ApiOperation("组局详情")
    public BaseResult<GroupDetailVo> groupDetail(@RequestParam("groupId") String groupId){
        return new BaseResult<GroupDetailVo>().ok(groupService.webGroupDetail(groupId));
    }

    @GetMapping("groupPoster")
    @ApiOperation("组局海报")
    @PassToken
    public BaseResult<QrCodeVo> scriptPoster(@RequestParam("groupId") String groupId){
        return new BaseResult<QrCodeVo>().ok(groupService.groupPoster(groupId));
    }
}
